import java.lang.reflect.Array;
import java.util.Arrays;

public class Test {




        public static void sortArr(int[] arr) {
            int count = 0;
            for (int i = 0; i < arr.length; i++) {
                if (arr[i] % 2 == 1) {
                    count ++;
                    int tmp = arr[i];
                    arr[i] = arr[count -1];
                    arr[count -1] = tmp;
                }

            }
        }

        public static void main(String[] args) {
            int[] array = {1,2,2,2,3,4,5,6};
            sortArr(array);
            System.out.println(Arrays.toString(array));
        }
        

}
